<template>
    <!-- // 4G边缘速率性能表-华为(天) -->
    <index-card :indexCardTitle="indexCardTitle">
        <el-table :data="tableData" v-loading="loading">
            <el-table-column prop="starttime" label="开始时间" min-width="200">
                <template #default="scope">
                    {{ scope.row.starttime ? formatDateNormal(scope.row.starttime) : null }}
                </template>
            </el-table-column>
            <el-table-column prop="cityName" label="地市名称" min-width="200" />
            <el-table-column prop="cgi" label="小区CGI" min-width="200" />
            <el-table-column prop="cellName" label="小区中文名" min-width="200" />
            <el-table-column prop="counter1526729056" label="下行吞吐率在区间0内的样本数" min-width="200" />
            <el-table-column prop="counter1526729057" label="下行吞吐率在区间1内的样本数" min-width="200" />
            <el-table-column prop="counter1526729058" label="下行吞吐率在区间2内的样本数" min-width="200" />
            <el-table-column prop="counter1526729059" label="下行吞吐率在区间3内的样本数" min-width="200" />
            <el-table-column prop="counter1526729060" label="下行吞吐率在区间4内的样本数" min-width="200" />
            <el-table-column prop="counter1526729061" label="下行吞吐率在区间5内的样本数" min-width="200" />
            <el-table-column prop="counter1526729062" label="下行吞吐率在区间6内的样本数" min-width="200" />
            <el-table-column prop="counter1526729063" label="下行吞吐率在区间7内的样本数" min-width="200" />
            <el-table-column prop="counter1526729064" label="下行吞吐率在区间8内的样本数" min-width="200" />
            <el-table-column prop="counter1526729065" label="下行吞吐率在区间9内的样本数" min-width="200" />
            <el-table-column prop="counter1526729435" label="上行吞吐率在区间0内的样本数" min-width="200" />
            <el-table-column prop="counter1526729436" label="上行吞吐率在区间1内的样本数" min-width="200" />
            <el-table-column prop="counter1526729437" label="下行吞吐率在区间2内的样本数" min-width="200" />
            <el-table-column prop="counter1526729438" label="上行吞吐率在区间3内的样本数" min-width="200" />
            <el-table-column prop="counter1526729439" label="上行吞吐率在区间4内的样本数" min-width="200" />
            <el-table-column prop="counter1526729440" label="上行吞吐率在区间5内的样本数" min-width="200" />
            <el-table-column prop="counter1526729441" label="上行吞吐率在区间6内的样本数" min-width="200" />
            <el-table-column prop="counter1526729442" label="上行吞吐率在区间7内的样本数" min-width="200" />
            <el-table-column prop="counter1526729443" label="上行吞吐率在区间8内的样本数" min-width="200" />
            <el-table-column prop="counter1526729444" label="上行吞吐率在区间9内的样本数" min-width="200" />
            <el-table-column prop="kpiThrpDlBitrateSampIndex09" label="下行吞吐率在各区间内的样本总数" min-width="200" />
            <el-table-column prop="kpiThrpDlBitrateSampIndex01" label="下行吞吐率在区间0~1内的样本数" min-width="200" />
            <el-table-column prop="kpiThrpDlBitrateSampIndex01Rate" label="下行吞吐率在区间0~1内的样本比例(%)" min-width="200" />
            <el-table-column prop="kpiThrpUlBitrateSampIndex09" label="上行吞吐率在各区间内的样本总数" min-width="200" />
            <el-table-column prop="kpiThrpDlBitRateSampIndex0Rate" label="上行吞吐率在区间0内的样本比例(%)" min-width="200" />
        </el-table>
    </index-card>
</template>

<script setup>
import { ref } from "vue";
import { apiCommon, formatDateNormal } from "@/utils/index.js";
import * as qualityApi from "@/api/biz/networkQuality";
import mittBus from "@/utils/mittBus"; // mitt事件总线

mittBus.on("get4GIndexItemData", (params) => {
    getData(params)
});

const props = defineProps({
    indexCardTitle: {
        type: String,
        default: '',
    },
    rowsData: {
        type: Object,
        default: () => { },
    },
});

const tableData = ref([]);
let loading = ref(false);

const getData = async (params) => {
    // console.log('params', params)

    loading.value = true;
    tableData.value = await apiCommon(qualityApi.getLteEdgeRateList, params);
    tableData.value = tableData.value.data;
    loading.value = false;
}

getData(props.rowsData);
</script>